<template>
  <div>
    <!-- 页面标题 -->
    <div id="family-file-title">
      <div style="width:200px;float:left;height:100%">
        <h1 style="margin-left:50px">家庭档案</h1>
      </div>
      <div style="float:right;height:100%;margin-left:20%">
        <el-button
          type="primary"
          style="float:left;margin-top:10px"
          @click="back"
          >返回</el-button
        >
      </div>
    </div>
    <div id="family-file-messagediv">
      <div class="family-file-messagetop">
        <i class="el-icon-document" style="margin-left:20px"></i
        >&nbsp;&nbsp;成员信息
      </div>
      <el-descriptions class="margin-top" :column="2" border >
        <template slot="extra"> </template>
        <el-descriptions-item style="border:0px solid red">
          <template slot="label">
            <i class="el-icon-postcard" style="margin-left: 0px;"></i>
            ID
          </template>
          {{ this.userid }}
        </el-descriptions-item>
        <el-descriptions-item style="width: 200px;">
          <template slot="label">
            <i class="el-icon-c-scale-to-original"></i>
            姓名
          </template>
          {{this.familyfiles.name}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-copy-document"></i>
            就诊人关系
          </template>
          本人
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-tickets"></i>
            身份证号
          </template>
          {{this.familyfiles.id_card_num}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-bank-card"></i>
            社保卡
          </template>
          {{this.familyfiles.security_card}}
        </el-descriptions-item>
        <el-descriptions-item label="nan">
          <template slot="label">
            <i class="el-icon-user-solid"></i>
            性别
          </template>
          {{this.editForm.sex=this.familyfiles.gender==0?yvalue:nvalue}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-date"></i>
            出生年月
          </template>
          {{this.familyfiles.birthday}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-mobile"></i>
            联系电话
          </template>
          {{this.familyfiles.telphone}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-s-home"></i>
            所在地区
          </template>
          {{this.familyfiles.address}}
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <i class="el-icon-date"></i>
            加入时间
          </template>
          {{this.familyfiles.join_time}}
        </el-descriptions-item>
      </el-descriptions>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      editForm: {
        id: "",
        username: "",
        name: "",
        telephone: "",
        gender: "",
        security_card: "",
        birthday: "",
        address: "",
        id_card_num: "",
        status: "",
        symptom: "",
        sid: "",
        join_time: "",
        is_delete: "",
        create_time: "",
        update_time: "",
        sex:""
      },
      familyfiles: [],
      userid: "",
      yvalue:"女",
      nvalue:"男"
    };
  },
  //注册组件
  components: {},
  created() {
    //请求患者信息
    this.userid = this.$route.params.userid;
    this.showData();
  },
  methods: {
    //展示档案信息
    showData() {
      this.$axios
        .get("/user/findByRecord/" + this.userid)
        .then(res => {
          console.log(res)
          if(res.data.code==200){
               this.familyfiles=res.data.data
               console.log(this.familyfiles)
          }
        })
        .catch();
    },

    back() {
      this.$router.back(-1);
    },
    scrollBehavior(to, from, savedPosition) {
      return { x: 0, y: 0 };
    }
  }
};
</script>
<style scoped>
* {
  /* border: 1px solid red; */
  border-radius: 3px;
}
#family-file-title {
  margin-left: 50px;
  margin-right: 50px;
  height: 60px;
}
#family-file-messagediv {
  margin-left: 50px;
  margin-right: 50px;
  margin-top: 10px;
  border: 1px solid gainsboro;
  border-radius: 3px;
  overflow: hidden;
}
.family-file-messagetop {
  width: 100%;
  height: 50px;
  background-color: #f0f0f0;
  line-height: 50px;
  font-size: 20px;
}
.el-icon-document {
  font-size: 30px;
  margin-top: 10px;
}
#family-file-messagebottom {
  font-size: 20px;
  overflow: hidden;
  margin: 10px;
}
.fengdi {
  color: red;
  border: 1px solid #ff55ff;
}
</style>
